# Maintainer: Anatol Pomozov
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Thomas Krug <t.krug@elektronenpumpe.de>

pkgname=libserialport
pkgver=0.1.1
pkgrel=5
pkgdesc='A minimal library that provides OS abstraction when interfacing serial ports'
arch=('loong64' 'x86_64')
url='https://sigrok.org/wiki/Libserialport'
license=('GPL3')
depends=('glibc')
source=("https://sigrok.org/download/source/libserialport/libserialport-$pkgver.tar.gz"
        "diable_termiox.patch::https://sigrok.org/gitweb/?p=libserialport.git;a=patch;h=6f9b03e597ea7200eb616a4e410add3dd1690cb1")
sha512sums=('7d379d1099173841e6d4df04c8c12dc6a4ebdfa0323ef35da6f3dea20db55d4f6ad81c1f6679f5aac7fe83270176428a817daa8627c336505335a07e06350a85'
            'b4834dedc393ba23c80c6487b41c69c273f11ce201c72d54668003774226883a9185c295a3ac2cc33d6075dbf38921c67f4d39a160656884c67152f75951822f')

prepare() {
  cd $pkgname-$pkgver

  patch -p1 < ../diable_termiox.patch # FS#72151
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install
}

